
'unit tests for TEngine

Type GameEngineTest Extends TTest

	Field c:TEngine
	
	
	Method Before() {before}
		c = New TEngine
	End Method
	
	Method After() {after}
		c = Null
	End Method
	
	
	Method Constructor() {test}
		c = New TEngine
		assertNotNull(c, "could not create gamestate.")
		assertNotNull(c._timer, "timer not created")
	End Method
	
	
	Method FancyContructor() {test}	
		Local g:TGameMock = New TGameMock
		c = TEngine.Create(g)
		
		assertNotNull(c)
		assertNotNull(c._game)		
	End Method
	
	
	Method SetVSync() {test}
		c.SetVSync(False)
		assertFalse(c.GetVSync())
	End Method
	
	
	Method SetPaused() {test}
		c.SetPaused(False)
		assertFalse(c.IsPaused())
	End Method
	
	
	Method RequestStop(){test}
		c.RequestStop()
		assertFalse(c._running)
	End Method
	
	
	Method SetAndSetGame() {test}
		Local g:TGameMock = New TGameMock
		c.SetGame(g)
		assertSame(g, c.getgame())
	End Method

End Type
